<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    if (window.WebSocket) {
//alert('can exe WebSocket'+$("#sid").html());41B73719DE0FF906075DB4F0DC4E57AD
    }
    var ws = new WebSocket("ws:/localhost:8080/playViews/$sid/" + $lid + "/webSocket");

    ws.onopen = function () {
        console.log("open");

        ws.send("hello");

    };

    ws.onmessage = function (evt) {

        console.log(evt.data);
        alert(evt.data);
        if (evt.data == 1) {
            alert('账号已在其他地方登录');
            window.location.href = "loginPage?backurl=" + window.location.href;
        }

    };

    ws.onclose = function (evt) {

        console.log("WebSocketClosed!");

    };

    ws.onerror = function (evt) {

        console.log("WebSocketError!");

    };

</script>
</html>